<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>LagouPhone秒杀</title>
    <script type="text/javascript" src="https://www.lgstatic.com/lg-www-fed/pkg/vendor_e97ade5.js"></script>
</head>
<body>
<input type="hidden" id="orderId" value="" th:value="${orderId}" />
您已经秒杀到LagouPhone了，请在30秒内完成付款,否则订单作废
<input type="button" name="toPay" value="去付款" id="toPay" />
<script>
    $('#toPay').click(function () {
        $.ajax({
            url:'http://localhost:8080/seckill/toPay?orderId='+$('#orderId').val(),
            type:'post',
            data:{'msg':''},
            success: function (data) {
                console.log(data);
                alert(data.msg);
                if (data.code == 0){
                    window.location.href = "/seckill/payedSuccess?orderId="+$('#orderId').val();
                }
            }
        });
    });
</script>
</body>
</html>
